package bms.junit;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import pers.yaoliguo.bms.entity.SysUser;
import pers.yaoliguo.bms.service.ISysUserService;
import pers.yaoliguo.bms.uitl.MD5Util;
import pers.yaoliguo.bms.uitl.StringHelper;

/**
 * @ClassName:       JunitSysUser
 * @Description:    TODO
 * @author:            yao
 * @date:            2017年6月25日        下午7:57:44
 */
//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations = {"classpath:spring_bean.xml"})  
public class JunitSysUser {

	//@Autowired
	//ISysUserService sysUserService;
	
	//@Test
	/*public void insert(){
		
		SysUser user = new SysUser();
		user.setAccount("root");
		user.setCreateTime(new Date());
		user.setId(StringHelper.getUUID());
		user.setDel(false);
		user.setPassword(MD5Util.encrypt("root"));
		sysUserService.insert(user);
	}
	//@Test
	public void insertMany(){
		SysUser user = new SysUser();
		for(int i = 0;i < 100; i++){
			user.setAccount("root"+i);
			user.setCreateTime(new Date());
			user.setId(StringHelper.getUUID());
			user.setDel(false);
			user.setPassword(MD5Util.encrypt("root"+i));
			sysUserService.insert(user);
		}
		
		
	}*/
	@Test
	public void test() throws ParseException{
	Date d = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2017-06-25 20:10:56");
	d.getTime();
	System.out.println();	  
	}
}
